import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';

const TAG = 'DioPage';

class DioPage extends StatefulWidget {
  const DioPage({super.key});

  @override
  State<DioPage> createState() => _DioPageState();
}

class _DioPageState extends State<DioPage> {

  @override
  void initState() {
    super.initState();

    dioGet();
  }

  Future<void> dioGet() async {
    print('$TAG Call');
    final dio = Dio();
    // final response = await dio.get('https://pub.dev');
    final response = await dio.get("https://www.baidu.com");
    print('$TAG response.data = \n' + response.data);
  }

  @override
  Widget build(BuildContext context) {
    return const Placeholder();
  }
}
